Skip to content

feat(chat-monitor): 添加 thought 查询 API 以支持点击触发回复标签查看思考内容 - #1315

Merged
This-is-XiaoDeng merged 1 commit into
mainfrom
feat/chat-monitor-thought
Jul 30, 2026
Merged

feat(chat-monitor): 添加 thought 查询 API 以支持点击触发回复标签查看思考内容#1315
This-is-XiaoDeng merged 1 commit into
mainfrom
feat/chat-monitor-thought

Conversation

@This-is-XiaoDeng

Copy link
Copy Markdown
Member

变更内容

在 chat-monitor 插件中新增一个 API 端点,允许前端在点击 "触发回复" 标签时查看对应请求的 thought/reasoning 内容。

新增 API

GET /chat-monitor/sessions/{session_id}/messages/{msg_index}/thought

返回:

  • thought - LLM 返回的结构化 thought(ModelResponse 中的 thought 字段)
  • reasoning_content - MessageProcessor._latest_reasioning_content_cache 中的原始 reasoning
  • last_response - 最近一次 OpenAI API 响应体(包含完整 choices,可用于提取 reasoning_content)

前端配合

对应 PR: Moonlark-Dev/chat-monitor#(待创建)

chat-monitor 前端的修改:

  1. 添加 getMessageThought API 函数
  2. "触发回复"标签改为可点击,调用 thought API 并弹出 modal 展示

测试

  • 构建通过
  • 部署验证

@github-actions
github-actions Bot requested review from montmorill and xxtg666 July 29, 2026 07:40
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 10 complexity

Metric Results
Complexity 10

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@This-is-XiaoDeng
This-is-XiaoDeng merged commit 142bde0 into main Jul 30, 2026
5 checks passed
@This-is-XiaoDeng
This-is-XiaoDeng deleted the feat/chat-monitor-thought branch July 30, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants